﻿using System;

namespace ylyfDataCommon.Cypher
{
    public class Base64Provider:CypherProvider
    {
        public override string Encryption(string str, string KEY = null, string IV = null)
        {
            byte[] b = System.Text.Encoding.UTF8.GetBytes(str);
            return Convert.ToBase64String(b);
        }

        public override string Decryption(string str, string KEY = null, string IV = null)
        {
            return System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(str));
        }
    }
}